<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;


/*
 * 审核流程表
 */
class CreateWorkflowTable extends Migration
{
    /**
     * Run the migrations.
     * 审批流程
     * @return void
     */
    public function up()
    {
        Schema::create('workflow', function (Blueprint $table) {
            $table->increments('id');
	        $table->string('name')->comment('流程名称')->nullable();
	        $table->string('level')->comment('审核级别');
	        $table->integer('type')->comment('流程使用范围：1所有，2部分')->nullable();
	        $table->tinyInteger('style')->comment('审批类型：1排班审批,2中止审批,3调动审批,4终止结算审批')->nullable();
	        $table->integer('one')->comment('一级审核')->nullable();
	        $table->integer('two')->comment('二级审核')->nullable();
	        $table->integer('three')->comment('三级审核')->nullable();
	        $table->integer('four')->comment('四级审核')->nullable();
	        $table->string('create_name')->comment('创建人')->nullable();
	        $table->integer('create_uid')->comment('创建人id')->nullable();
	        $table->integer('status')->comment('配置状态：1有效，0无效')->default(0);
	        $table->integer('company_id')->comment('所属公司id')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('workflow');
    }
}
